package com.sugar.persistence.system.privilege.impl;

import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.sugar.common.base.persistence.IHibernateBaseDaoSupport;
import com.sugar.common.base.persistence.query.PageModel;
import com.sugar.domain.system.privilege.PrivilegeResourceItem;
import com.sugar.persistence.system.privilege.IPrivilegeResourceItem;

@Repository
public class PrivilegeResourceItemDao extends IHibernateBaseDaoSupport<PrivilegeResourceItem> implements IPrivilegeResourceItem{

	@Override
	public void deletePrivilegeResourceItemDao(PrivilegeResourceItem pri)
			throws RuntimeException {
		this.deleteEntityBaseDao(pri) ;
	}

	@Override
	public void deleteSelectPrivilegeResourceItemDao(Object[] ids)
			throws RuntimeException {
		this.deleteEntityMoreIdBaseDao(PrivilegeResourceItem.class, ids) ;
	}

	@Override
	public List<PrivilegeResourceItem> findPrivilegeResourceItemDao(
			String queryString, String whereStr, Object[] param,
			LinkedHashMap<String, String> orderby) throws RuntimeException {
		
		return this.findMoreEntityByParam(queryString, whereStr, param, orderby) ;
	}

	@Override
	public PageModel<PrivilegeResourceItem> getScorllPrivilegeResourceItemDao(
			String queryString, String whereStr, Object[] param, int firstPage,
			int pageSize, LinkedHashMap<String, String> orderby)
			throws RuntimeException {
		
		return this.getScrollRecord(queryString, null, null, firstPage, pageSize) ;
	}

	@Override
	public PrivilegeResourceItem loadPrivilegeResourceItemByIdDao(int id)
			throws RuntimeException {
		
		return this.loadEntityById(PrivilegeResourceItem.class, id) ;
	}

	@Override
	public void savePrivilegeResourceItemDao(PrivilegeResourceItem pri)
			throws RuntimeException {
		this.saveEntityBaseDao(pri) ;
	}

	@Override
	public void updatePrivilegeResourceItemDao(PrivilegeResourceItem pri)
			throws RuntimeException {
		this.updateEntityBaseDao(pri) ;
	}

}
